<div class="content-top-nav">
    <h3 style="color:#444"><i class="layui-icon layui-icon-home"></i> <?php echo lang('home_home');?> </h3>
    <hr>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <blockquote class="layui-elem-quote"><?php echo lang('home_welcomeAdmin');?>：
                        <span><?php echo sessionInfo("groupname");?> <?php echo sessionInfo("nickname");?>(<?php echo sessionInfo("username");?>)</span>！你上次登录时间是:<?php echo sessionInfo("logintime");?>
                    </blockquote>
                </div>
            </div>
        </div>

<!--系统后台公告 S-->
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header"><?php echo lang('home_systemAnnouncement');?></div>
                <div class="layui-card-body ">
                    <ul class="layui-timeline">
                        <?php foreach($noticeList as $key=>$vo){?>
                        <li class="layui-timeline-item">
                            <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                            <div class="layui-timeline-content layui-text">
                                <h3 class="layui-timeline-title" style="color:red;"><{$vo['title']}></h3>
                                <p><?php echo nl2br($vo['content']);?><h4><{$vo['time']}></h4></p>
                                <?php if(!empty($vo['img'])){?>
                                 <p><img src="<{$vo['img']}>"></p>
                                <?php }?>
                            </div>
                        </li>
                        <?php } ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
<!--系统后台公告 E-->

    <!--统计图表展示 S-->
    <?php if(sysrolTF("index_articlecount")){ ?>
        <div class="layui-col-md12">
            <div class="layui-col-md7">
                <div class="layui-col-md6" height="150"><canvas id="catenian"></canvas></div>
                <div class="layui-col-md6" height="150"><canvas id="cateyue"></canvas></div>
                <div class="layui-col-md12"><canvas id="meizhou" width="400" height="110"></canvas></div>
            </div>
            <div class="layui-col-md5">
                <div class="layui-col-md12"><canvas id="meiyue" width="400" height="145"></canvas></div>
                <div class="layui-col-md12"><canvas id="meinian" width="400" height="145"></canvas></div>
            </div>
        </div>	
    <?php  } ?>
    <!--统计图表展示 E-->

    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-header"><?php echo lang('home_developerInformation');?></div>
            <div class="layui-card-body ">
                <table class="layui-table">
                    <tbody>
                        <tr>
                            <th>版权所有</th>
                            <td><?php echo lang('home_name');?> <a href="http://www.cxuu.top/" target="_blank">访问官网 cxuu.top</a></td>
                        </tr>
                        <tr>
                            <th>系统版本</th>
                            <td><?php echo CXUUCMS_V;?></td>
                        </tr>
                        <tr>
                            <th>开发者</th>
                            <td>CDeng </td>
                        </tr>
                        <tr>
                            <th>基于</th>
                            <td>PHP 7.1+ MySql5.6+ <a href="https://gitee.com/o123/Z-PHP" target="_blank">Z-PHP V_<?php echo ZPHP_VER;?></a> Layui 2.5.6</td>
                        </tr>
                        <tr>
                            <th>本程序git地址</th>
                            <td>https://gitee.com/4856742/cxuucms-zphp</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
</div>
<?php if(sysrolTF("index_articlecount")){ ?>
<script src="<{U_ROOT}>/res/lib/chart/Chart.min.js"></script>
<?php $count = \model\article::findCount();?>
<script>
var catenian = document.getElementById('catenian').getContext('2d');
var cateyue = document.getElementById('cateyue').getContext('2d');
var meiyue = document.getElementById('meiyue').getContext('2d');
var meizhou = document.getElementById('meizhou').getContext('2d');
var meinian = document.getElementById('meinian').getContext('2d');
var catenianChart = new Chart(catenian, {
    type: 'pie',
    data: {
        labels:[<?php foreach($count['catenian'] as $vo){echo '\''.$vo['catename'].'\',';} ?>],
        datasets: [{
            label: '栏目量',
            data: [<?php foreach($count['catenian'] as $vo){echo $vo['total'].',';} ?>],
            backgroundColor: [<?php foreach($count['catenian'] as $vo){echo "'".$vo['color']."',";} ?>],
            borderColor:'#fff',
            borderWidth: 1
        }]
    },
    
    options: {
        responsive: true,
			hoverMode: 'index',
			stacked: false,
			title: {
				display: true,
				text: '本年栏目类型分析统计'
            }
        }
    });
var cateyueChart = new Chart(cateyue, {
    type: 'doughnut',
    data: {
        labels:[<?php foreach($count['cateyue'] as $vo){echo '\''.$vo['catename'].'\',';} ?>],
        datasets: [{
            label: '栏目案件量',
            data: [<?php foreach($count['cateyue'] as $vo){echo $vo['total'].',';} ?>],
            backgroundColor: [<?php foreach($count['cateyue'] as $vo){echo "'".$vo['color']."',";} ?>],
            borderColor:'#fff',
            borderWidth: 1
        }]
    },
    
    options: {
        responsive: true,
			hoverMode: 'index',
			stacked: false,
			title: {
				display: true,
				text: '本月栏目分析统计'
            },
    }
});
var meiyueChart = new Chart(meiyue, {
    type: 'bar',
    data: {
        labels:[<?php foreach($count['meiyue'] as $vo){ echo $vo['months'].','; } ?>],
        datasets: [{
            label: '月发布量',
            data: [<?php foreach($count['meiyueBJ'] as $vo){ echo $vo['total'].','; } ?>],
            backgroundColor: '#f69cfc',
            borderColor:'#bd35c6',
            borderWidth: 1
        },{
            label: '月信息量',
            data: [<?php foreach($count['meiyue'] as $vo){ echo $vo['total'].','; } ?>],
            backgroundColor: '#9cddfc',
            borderColor:'#2ebbff',
            borderWidth: 1
        }]
    },
    
    options: {
        responsive: true,
			hoverMode: 'index',
			stacked: false,
			title: {
				display: true,
				text: '每月信息量统计'
			},
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero: true
                }
            }]
        }
    }
});

var meizhouChart = new Chart(meizhou, {
    type: 'bar',
    data: {
        labels:[<?php foreach($count['meizhou'] as $vo){echo $vo['weeks'].',';} ?>],
        datasets: [{
            label: '周发布量',
            data: [<?php foreach($count['meizhouBJ'] as $vo){echo $vo['total'].',';} ?>],
            backgroundColor: '#f69cfc',
            borderColor:'#bd35c6',
            borderWidth: 1
        },{
            label: '周信息量',
            data: [<?php foreach($count['meizhou'] as $vo){echo $vo['total'].',';} ?>],
            backgroundColor: '#9cddfc',
            borderColor:'#2ebbff',
            borderWidth: 1
        }]
    },
    
    options: {
        responsive: true,
			hoverMode: 'index',
			stacked: false,
			title: {
				display: true,
				text: '每周信息量统计'
			},
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero: true
                }
            }]
        }
    }
});

var meinianChart = new Chart(meinian, {
    type: 'bar',
    data: {
        labels:[<?php foreach($count['meinian'] as $vo){echo $vo['years'].',';} ?>],
        datasets: [{
            label: '年信息量',
            data: [<?php foreach($count['meinianBJ'] as $vo){echo $vo['total'].',';} ?>],
            backgroundColor: '#f69cfc',
            borderColor:'#bd35c6',
            borderWidth: 1
        },{
            label: '年信息量',
            data: [<?php foreach($count['meinian'] as $vo){echo $vo['total'].',';} ?>],
            backgroundColor: '#9cddfc',
            borderColor:'#2ebbff',
            borderWidth: 1
        }]
    },
    
    options: {
        responsive: true,
			hoverMode: 'index',
			stacked: false,
			title: {
				display: true,
				text: '每年信息量统计'
			},
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero: true
                }
            }]
        }
    }
});

</script>

<?php  } ?>